This is a specialised List used for manipulating and querying resources You'll usually this to sort, group, filter lists, as well as create new lists which you can add to in the template


Properties

Name Returns Notes Example
first CommonResource Return the first item in the list
last CommonResource Return the last item in the list
random CommonResource Get any single item at random
reverse ResourceList Reverse the order of elements in the list
sortByModifiedDate ResourceList Returns a new list where all articles are sorted by their modified date.
sortByName ResourceList Returns a new list where all articles are sorted by their name.
sortByTitle ResourceList Returns a new list where all articles are sorted by their title, if they have one, otherwise their name
randomSort ResourceList Returns a new list where all articles are sorted randomly.
ofType Map Returns a map which you can use to filter by type
$folder.children.ofType.folder
$folder.find("/blogs").articles.ofType.news
dirs ResourceList Returns a list of only directories from this list
files ResourceList Returns a list of only files (ie not directories) from this list
parents ResourceList For each item in this list, return all of its parents up to the website

Methods

Name Returns Notes Example
get ( name ) CommonResource
hasChild ( name ) boolean
remove ( o ) boolean
exclude ( s ) ResourceList
exclude ( s1, s2 ) ResourceList
exclude ( s1, s2, s3 ) ResourceList
_exclude ( s ) ResourceList
excludeType ( s ) ResourceList Return a list containing the current elements except any resources of the given type
excludeType ( s1, s2 ) ResourceList Return a list containing the current elements except any resources of the given types
excludeType ( s1, s2, s3 ) ResourceList Return a list containing the current elements except any resources of the given types
excludeType ( s1, s2, s3, s4 ) ResourceList Return a list containing the current elements except any resources of the given types
ofType ( s ) ResourceList
ofTypeOr ( orTypes ) ResourceList
truncate ( maxSize ) ResourceList
next ( from ) Resource
previous ( from ) Resource
sortByField ( fieldName ) ResourceList
sortByIntField ( fieldName ) ResourceList
after ( n ) ResourceList

Ask a question, or offer an answer